<template>
  <footer class="footer">
    <span class="todo-count">剩余<strong>{{ len }}</strong></span>
    <ul class="filters">
      <li>
        <a :class="{selected:type === 'all'}" href="javascript:;" @click="$emit('chang','all')">全部</a>
      </li>
      <li>
        <a :class="{selected:type === 'no'}" href="javascript:;" @click="$emit('chang','no')">未完成</a>
      </li>
      <li>
        <a :class="{selected:type === 'yes'}" href="javascript:;" @click="$emit('chang','yes')">已完成</a>
      </li>
    </ul>
    <button class="clear-completed" @click="$emit('clearBtn')">清除已完成</button>
  </footer>
</template>

<script>
export default {
    //定义list变量，接收父传来的值
    props:{
        type:String,
        len:Number
    },
}
</script>